package cn.wubo.xianxiacomment.utils

import com.intellij.psi.PsiMethod

fun PsiMethod.addCommentBefore(comment: String) {
    val project = this.project
    val factory = com.intellij.psi.JavaPsiFacade.getElementFactory(project)
    val commentElement = factory.createCommentFromText(comment, this)
    this.addBefore(commentElement, this.firstChild)
}